package br.unb.mestrado.simulator.model.simulator.formula;

import br.unb.mestrado.simulator.model.monitoring.State;
import br.unb.mestrado.simulator.model.simulator.PriorityPercentage;

public class GoalParameter {

	public enum GoalParameterType{
		RELIABILITY, QUALITY, QUANTITY, LIFETIME, SAMPLE
	};
	
	private GoalParameterType type;
	private int priority;
	private double goalNormal;
	private double goalModerate;
	private double goalHigh;
	private double percentage;
	

	public GoalParameter(PriorityPercentage pp, double goalNormal, double goalModerate,
			double goalHigh) {
		super();
		this.priority = pp.getPriority();
		this.percentage = pp.getPercentage();
		this.goalNormal = goalNormal;
		this.goalModerate = goalModerate;
		this.goalHigh = goalHigh;
	}
	
	public int getPriority() {
		return priority;
	}
	public void setPriority(int priority) {
		this.priority = priority;
	}
	public double getGoalNormal() {
		return goalNormal;
	}
	public void setGoalNormal(double goalNormal) {
		this.goalNormal = goalNormal;
	}
	public double getGoalModerate() {
		return goalModerate;
	}
	public void setGoalModerate(double goalModerate) {
		this.goalModerate = goalModerate;
	}
	public double getGoalHigh() {
		return goalHigh;
	}
	public void setGoalHigh(double goalHigh) {
		this.goalHigh = goalHigh;
	}
	public double getPercentage() {
		return percentage;
	}
	public void setPercentage(double percentage) {
		this.percentage = percentage;
	}

	@Override
	public String toString() {
		return "" + priority +""+ ", "
				+ goalNormal + ", " + goalModerate + ", "
				+ goalHigh + "";
	}

	public GoalParameterType getType() {
		return type;
	}

	public void setType(GoalParameterType type) {
		this.type = type;
	}

	public double getGoal(State state) {
		if(state.equals(State.N)){
			return getGoalNormal();
		}else if(state.equals(State.M)){
			return getGoalModerate();
		}else if(state.equals(State.H)){
			return getGoalHigh();
		}
		return 0;
	}

	
	
}
